

@RestController
@RequestMapping("/dmsMachineMaintenanceRule")
public class DmsMachineMaintenanceRuleController {

    @Resource
    private DmsMachineMaintenanceRuleService dmsMachineMaintenanceRuleService;


    /**
     * 获取 DmsMachineMaintenanceRule 分页列表
     */
    @GetMapping("/pagination")
    public Ret getDmsMachineMaintenanceRulePagination( PaginationVo paginationVo, DmsMachineMaintenanceRuleQuery dmsMachineMaintenanceRuleQuery ) throws Exception {
        IPage page = dmsMachineMaintenanceRuleService.getDmsMachineMaintenanceRulePagination(paginationVo, dmsMachineMaintenanceRuleQuery );
        return Ret.toPage(page);
    }


    /**
     * 获取 DmsMachineMaintenanceRule 所有数据
     */
    @GetMapping("/all")
    public Ret getDmsMachineMaintenanceRuleAllList( DmsMachineMaintenanceRuleQuery dmsMachineMaintenanceRuleQuery ) throws Exception {
        List<DmsMachineMaintenanceRuleEntity> list = dmsMachineMaintenanceRuleService.getDmsMachineMaintenanceRuleAllList( dmsMachineMaintenanceRuleQuery );
        return Ret.ok(list);
    }



    /**
     * 获取 DmsMachineMaintenanceRule 详情
    */
   @GetMapping("/{id}")
   public Ret getDmsMachineMaintenanceRuleDetail(@PathVariable Long id) throws Exception {

       DmsMachineMaintenanceRuleEntity dmsMachineMaintenanceRule = dmsMachineMaintenanceRuleService.getDmsMachineMaintenanceRuleDetail(id);
       return Ret.ok(dmsMachineMaintenanceRule);
   }


    /**
     * 新增 DmsMachineMaintenanceRule
     * */
    @PostMapping("")
    public Ret addDmsMachineMaintenanceRule(@RequestBody DmsMachineMaintenanceRuleVo dmsMachineMaintenanceRuleVo) throws Exception {

        dmsMachineMaintenanceRuleService.addDmsMachineMaintenanceRule(dmsMachineMaintenanceRuleVo);
        return Ret.ok();
    }


    /**
     * 更新 DmsMachineMaintenanceRule
     * */
    @PutMapping("")
    public Ret updateDmsMachineMaintenanceRule(@RequestBody DmsMachineMaintenanceRuleVo dmsMachineMaintenanceRuleVo) throws Exception {

        dmsMachineMaintenanceRuleService.updateDmsMachineMaintenanceRule(dmsMachineMaintenanceRuleVo);
        return Ret.ok();
    }


    /**
     * 删除 DmsMachineMaintenanceRule
     * */
    @PostMapping("/batchRemove")
    public Ret batchRemoveDmsMachineMaintenanceRule( @RequestBody List<Long> ids ) throws Exception {

        dmsMachineMaintenanceRuleService.batchRemoveDmsMachineMaintenanceRule(ids);
        return Ret.ok();
    }
}

  